package cmpe226.spring2011.project1;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

public class CSVPrinter {
    
    public static void FilePrinter(List <List<String>> array, File outFile) {
        
        try{
            FileWriter out = new FileWriter(outFile);
            for (List<String> current : array) {
                for(int j = 0; j < current.size(); j++) {
                    out.append(current.get(j));
                    out.append(',');
                }
                out.append('\n');
            }
            out.close();
        }catch(IOException e) {
             System.out.println("IO Exception " + e.getMessage());
             System.exit(-1);
        }
    }
}
